package dao.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * IfwCardInfo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ifw_card_info", catalog = "fw")
public class IfwCardInfo extends BasePojo implements java.io.Serializable {

	// Fields

	private Integer cardIndex;
	private String cardNum;
	private Integer host;
	private Integer ac;
	private Integer time;
	private String cardSta;
	private Integer timeSec;
	private Set<IfwRechargeInfo> ifwRechargeInfos = new HashSet<IfwRechargeInfo>(
			0);
	private Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords = new HashSet<IfwAgentConsumeRecord>(
			0);

	@Override
	public Object getEntityId() {
		// TODO Auto-generated method stub
		return cardIndex;
	}
	
	@Id
	@TableGenerator(name = "CARDINDEX_GEN", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_CARDINDEX", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "CARDINDEX_GEN")
	@Column(name = "card_index", unique = true, nullable = false)
	public Integer getCardIndex() {
		return this.cardIndex;
	}

	public void setCardIndex(Integer cardIndex) {
		this.cardIndex = cardIndex;
	}

	@Column(name = "card_num", nullable = false, length = 32)
	public String getCardNum() {
		return this.cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	@Column(name = "host", nullable = false)
	public Integer getHost() {
		return this.host;
	}

	public void setHost(Integer host) {
		this.host = host;
	}

	@Column(name = "ac", nullable = false)
	public Integer getAc() {
		return this.ac;
	}

	public void setAc(Integer ac) {
		this.ac = ac;
	}

	@Column(name = "time", nullable = false)
	public Integer getTime() {
		return this.time;
	}

	public void setTime(Integer time) {
		this.time = time;
	}

	@Column(name = "card_sta", nullable = false, length = 10)
	public String getCardSta() {
		return this.cardSta;
	}

	public void setCardSta(String cardSta) {
		this.cardSta = cardSta;
	}

	@Column(name = "time_sec", nullable = false)
	public Integer getTimeSec() {
		return timeSec;
	}
	
	public void setTimeSec(Integer timeSec) {
		this.timeSec = timeSec;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwCardInfo")
	public Set<IfwRechargeInfo> getIfwRechargeInfos() {
		return this.ifwRechargeInfos;
	}

	public void setIfwRechargeInfos(Set<IfwRechargeInfo> ifwRechargeInfos) {
		this.ifwRechargeInfos = ifwRechargeInfos;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "ifwCardInfo")
	public Set<IfwAgentConsumeRecord> getIfwAgentConsumeRecords() {
		return this.ifwAgentConsumeRecords;
	}

	public void setIfwAgentConsumeRecords(
			Set<IfwAgentConsumeRecord> ifwAgentConsumeRecords) {
		this.ifwAgentConsumeRecords = ifwAgentConsumeRecords;
	}

}